<% if @custom_tools_alert_visible %>
  <div class="w-full inset-auto bottom-0 z-50 mb-4 opacity-75 hover:opacity-100 transition-opacity duration-150">
    <a href="https://avohq.io/pricing" target="_blank" class="rounded bg-orange-700 text-white py-2 px-4 text-sm block items-center flex leading-tight">
      <%= svg "avo/exclamation", class: "h-6 inline mr-2 text-bold flex-shrink-0 mr-1" %> Warning. <%= @custom_tools_alert_visible %> This page will not be visible in a production environment.
    </a>
  </div>
<% end %>
<% if Avo.error_manager.has_errors? %>
  <% Avo.error_manager.all.each do |error| %>
    <% if error.is_a? Hash %>
      <%
        url, message, target = error.values_at :url, :message, :target
      %>
      <div class="w-full inset-auto bottom-0 z-50 mb-4 opacity-75 hover:opacity-100 transition-opacity duration-150">
        <a href="<%= url %>" target="<%= target %>" class="rounded bg-orange-700 text-white py-2 px-4 text-sm items-center flex leading-tight space-x-2">
          <%= svg "avo/exclamation", class: "h-6 inline mr-2 text-bold flex-shrink-0 mr-1" %>
          <div>
            <%= simple_format message %>
          </div>
        </a>
      </div>
    <% elsif error.is_a? String %>
      <div class="w-full inset-auto bottom-0 z-50 mb-4 opacity-75 hover:opacity-100 transition-opacity duration-150">
        <div class="rounded bg-orange-700 text-white py-2 px-4 text-sm items-center flex leading-tight space-x-2">
          <%= svg "avo/exclamation", class: "h-6 inline mr-2 text-bold flex-shrink-0 mr-1" %>
          <div><%= simple_format error %></div>
        </div>
      </div>
    <% end %>
  <% end %>
<% end %>
